﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Task
{
    public partial class ESI_TBConfigTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTaskId.Text))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>alert('TaskId不能为空');</script>");
                return;
            }
            ESISyncTableLogic sync = new ESISyncTableLogic();

            bool flag = sync.SyncTable(txtTaskId.Text);
            if (flag)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>alert('同步业务表数据成功');</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>alert('同步业务表数据失败');</script>");
            }
        }
        protected void btnOpen_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtProcessName.Text))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>alert('流程名称不能为空');</script>");
                return;
            }
            Response.Redirect("ESI_TBConfigList.aspx?ProcessName=" + txtProcessName.Text);
        }
    }
}